package org.despair2D.ui.core 
{
	import flash.display.DisplayObject;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import org.despair2D.renderer.IView;
	import org.despair2D.ui.Fusion;
	
	[Event(name = "press", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "release", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "over", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "leave", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "move", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "click", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "drag", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "killed", type = "org.despair2D.ui.events.ManipulateEvent")] 
	
	[Event(name = "interactiveChange", type = "org.despair2D.ui.events.InteractiveEvent")] 
	
	[Event(name = "visibleChange", type = "org.despair2D.ui.events.VisibleEvent")] 
	
public interface IComponent extends IView
{
	
	/** ◇显示对象 **/
	function get displayObject() : DisplayObject
	
	/** ◇全局坐标 **/
	function get globalPos() : Point
	
	/** ◇图层 **/
	function get layer() : int
	
	/** ◇合体 **/
	function get fusion() : Fusion
	
	/** ◇是否滑上 **/
	function get hovered() : Boolean
	
	/** ◇是否按下 **/
	function get pressed() : Boolean
	
	/** ◇是否拖动中 **/
	function get dragging() : Boolean
	
	/** ◇是否拖动范围内 **/
	function get draggingInBounds() : Boolean
	
	/** ◇空间宽度 **/
	function get spaceWidth() : Number
	function set spaceWidth( v:Number ) : void
	
	/** ◇空间高度 **/
	function get spaceHeight() : Number
	function set spaceHeight( v:Number ) : void
	
	
	/**
	 * ◆全局移动
	 * @param	gx
	 * @param	gy
	 */
	function moveInStage( gx:Number, gy:Number ) : void
	
	/**
	 * ◆开始拖动
	 * @param	lockCenter
	 * @param	bounds
	 */
	function startDrag( lockCenter:Boolean = false, bounds:Rectangle = null ) : void
	
	/**
	 * ◆停止拖动
	 * 
	 * @usage	未拖动时使用，会发生错误!! 务必在前面判断dragging属性.
	 */
	function stopDrag( fireEvent:Boolean = false ) : void
	
	/**
	 * ◆是否为组件的部分
	 * @param	c
	 */
	function bePartOf ( c:IComponent ) : Boolean
	
	/**
	 * ◆杀死
	 */
	function kill() : void	
}
}